"""新建客户关怀页面"""
from selenium.webdriver import Keys

from page.base_page import BasePage
from selenium.webdriver.common.by import By


class NewCustomCarePage(BasePage):

    url = '/crm5/index.php?m=customer&a=caresadd'

    #定位器
    #关怀主题
    care_theme_locator = (By.XPATH,'//*[@id="name"]')
    #关怀日期
    care_time_locator = (By.XPATH,'//*[@id="care_time"]')

    #保存
    btn_submit_locator = (By.XPATH,'/html/body/div[5]/div[2]/div/form/table/tfoot/tr/td[2]/input[1]')

    def input_care_theme(self,care_theme):
        """点击查看"""
        self.driver.find_element(*self.care_theme_locator).send_keys(care_theme)

    def input_care_time(self,care_time):
        """输入关怀日期"""
        self.driver.find_element(*self.care_time_locator).send_keys(care_time)

    def click_btn_submit(self):
        """点击保存"""
        self.driver.find_element(*self.btn_submit_locator).click()

